import request from '@/router/axios';

//获取全部数据
export const getList = (currentPage, pageSize, params) => {
  return request({
    url: '/api/flowers/showFlowersTable',
    method: 'get',
    params: {
      ...params,
      currentPage,
      pageSize
    }
  })
}

//获取全部类别
export const getTypeList = () => {
    return request({
      url: '/api/flowers/selAllFlowerType?currentPage=1&pageSize=100',
      method: 'get',
      params: {       
        
      }
    })
  }

//删除数据
export const remove = (ids) => {
  return request({
    url: '/api/flowers/deleteFlowers',
    method: 'post',
    params: {
      ids,
    }
  })
}


//添加花卉
export const add = (row) => {
  return request({
    url: '/api/flowers/addFlower',
    method: 'post',
    data:{
      row
    },
    params:{
      color: row.color,     
      name: row.name,     
      price: row.price,
      fid: row.fid,
      fname: row.fname,
      image: row.image
    }
  })
}


//修改花卉
export const update = (row) => {
  return request({
    url: '/api/flowers/updateFlower',
    method: 'post',
    data: row,
    params:{
      id:row.id,
      color: row.color,     
      name: row.name,     
      price: row.price,
      fid: row.fid,
      fname: row.fname      
    }
    
  })
}

export const getNotice = (id) => {
  return request({
    url: '/api/blade-desk/notice/detail',
    method: 'get',
    params: {
      id
    }
  })
}
